
package com.producttypemodule.bean;

import java.io.Serializable;

import com.producttypemodule.dao.TbProductTypeDAO;

public class TbProductType implements Serializable{

    private int productTypeId;

    private int productTypeLevel;

    private String productTypeName;

    private int parentTypeId;
    private TbProductType tbProductTypeParent;

    private int isMaxProductType;

    private String productTypeMemo;

    private String createTime;

    public int getProductTypeId(){
        return productTypeId;
    }

    public void setProductTypeId(int productTypeId){
        this.productTypeId = productTypeId;
    }

    public int getProductTypeLevel(){
        return productTypeLevel;
    }

    public void setProductTypeLevel(int productTypeLevel){
        this.productTypeLevel = productTypeLevel;
    }

    public String getProductTypeName(){
        return productTypeName;
    }

    public void setProductTypeName(String productTypeName){
        this.productTypeName = productTypeName;
    }

    public int getParentTypeId(){
        return parentTypeId;
    }

    public void setParentTypeId(int parentTypeId){
        this.parentTypeId = parentTypeId;
        this.tbProductTypeParent=this.parentTypeId==parentTypeId?this:new TbProductTypeDAO().getTbProductTypeByProductTypeId(parentTypeId);
    }

    public int getIsMaxProductType(){
        return isMaxProductType;
    }

    public void setIsMaxProductType(int isMaxProductType){
        this.isMaxProductType = isMaxProductType;
    }

    public String getProductTypeMemo(){
        return productTypeMemo;
    }

    public void setProductTypeMemo(String productTypeMemo){
        this.productTypeMemo = productTypeMemo;
    }

    public String getCreateTime(){
        return createTime;
    }

    public void setCreateTime(String createTime){
        this.createTime = createTime;
    }

    
    public TbProductType getTbProductTypeParent() {
		return tbProductTypeParent;
	}

	public void setTbProductTypeParent(TbProductType tbProductTypeParent) {
		this.tbProductTypeParent = tbProductTypeParent;
	}

	public TbProductType(){
    }
        public TbProductType(int productTypeLevel,String productTypeName,int parentTypeId,int isMaxProductType,String productTypeMemo){
        this.productTypeLevel = productTypeLevel;
        this.productTypeName = productTypeName;
        this.parentTypeId = parentTypeId;
        this.isMaxProductType = isMaxProductType;
        this.productTypeMemo = productTypeMemo;
    }
    public TbProductType(int productTypeId,int productTypeLevel,String productTypeName,int parentTypeId,int isMaxProductType,String productTypeMemo){
        this.productTypeId = productTypeId;
        this.productTypeLevel = productTypeLevel;
        this.productTypeName = productTypeName;
        this.parentTypeId = parentTypeId;
        this.isMaxProductType = isMaxProductType;
        this.productTypeMemo = productTypeMemo;
    }
}

